package com.yikes.srb.service;

import com.yikes.srb.common.result.PageResult;
import com.yikes.srb.leadingModle.form.userAccount.UserAccountAddForm;
import com.yikes.srb.leadingModle.form.userAccount.UserAccountEditForm;
import com.yikes.srb.leadingModle.form.userAccount.UserAccountQuery;
import com.yikes.srb.leadingModle.vo.UserAccountVO;
import com.yikes.srb.pojo.entity.UserAccount;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.validation.Valid;

import java.math.BigDecimal;
import java.util.Map;

/**
 * <p>
 * 用户账户 服务类
 * </p>
 *
 * @author guanrong.yin
 * @since 2024-12-03
 */
public interface UserAccountService extends IService<UserAccount> {

    /**
     * 分页查询
     *
     * @param query
     * @return
     */
    PageResult<UserAccountVO> listPage(UserAccountQuery query);

    /**
     * 根据id查询单条信息
     *
     * @param id
     * @return
     */
    UserAccountVO infoId(Long id);

    /**
     * 新增
     * @param form
     */
    void create(@Valid UserAccountAddForm form);

    /**
     * 编辑
     * @param form
     */
    void edit(@Valid UserAccountEditForm form);

    /**
     * 删除
     * @param id
     */
    void del(Long id);

    /**
     * 充值金额
     * @param chargeAmt
     * @param userId
     * @return
     */
    String commitCharge(BigDecimal chargeAmt, Long userId);

    /**
     * 用户充值异步回调
     *
     * @param paramMap
     * @return
     */
    String notify(Map<String, Object> paramMap);

    /**
     * 查询账户余额
     *
     * @param userId
     * @return
     */
    BigDecimal getAccount(Long userId);

    /**
     * 提现
     * @param fetchAmt
     * @param userId
     * @return
     */
    String commitWithdraw(BigDecimal fetchAmt, Long userId);

    /**
     * 用户提现异步回调
     * @param paramMap
     */
    void notifyWithdraw(Map<String, Object> paramMap);
}
